package it.avantsoft.ls.gl.data;

import it.avantsoft.ls.base.Protocol;
import it.avantsoft.ls.gl.GroupChildHandler;

public interface AddressBook {

    final int UPPERAB_ID = 0;
    final int CENTERAB_ID = 1;
    final int LOWERAB_ID = 2;

    public boolean add(GroupChildHandler child);

    public boolean add(String id, int port);

    public int size();

    public GroupChildHandler getBestPeer();

    public byte[] toByte();

    public boolean fromByte(byte[] byteArray);

    public boolean remove(String childId);

    public int getAbID();

    public boolean mergeAB(AddressBook newAddressBook);

    public GroupChildHandler getChildHandler(String childId);

    boolean hasPeerEntry(String childId);

    Protocol.ABProtocol updateAppraisals(Appraisals appraisals);


    public boolean peerKnown(String peerId);

}
